import http from "@/http";
import { AxiosRequestConfig } from "axios";

/**
 * @description: 通用文件上传接口
 */
export const uploadFile = (data: FormData, config: AxiosRequestConfig) => {
  return http
    .postReq({ url: "/file/upload", data, baseURL: "/", ...config })
    .then((res) => res.body);
};
/**
 * @description: 通用文件访问接口
 */
export const readFile = (fileId: string) => {
  return http.getReq({ url: "/file/read", params: { fileId }, baseURL: "/" });
};
